package com.ruoyi.patrol.service.impl;

import com.ruoyi.patrol.domain.PtWorkOrderType;
import com.ruoyi.patrol.mapper.PtWorkOrderTypeMapper;
import com.ruoyi.patrol.service.IPtWorkOrderTypeService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class PtWorkOrderTypeServiceImpl implements IPtWorkOrderTypeService {

    @Autowired
    private PtWorkOrderTypeMapper workOrderTypeMapper;


    @Override
    public int save(PtWorkOrderType workOrderType) {
        return workOrderTypeMapper.insertWorkOrderType(workOrderType);
    }

    @Override
    public List<PtWorkOrderType> selectWorkOrderTypeList(PtWorkOrderType workOrderType) {
        List<PtWorkOrderType> result = workOrderTypeMapper.selectWorkOrderTypeList(workOrderType);

        return result;
    }

    @Override
    public PtWorkOrderType selectWorkOrderTypeById(Long id) {
        return workOrderTypeMapper.selectWorkOrderTypeById(id);
    }

    @Override
    public int update(PtWorkOrderType workOrderType) {
        return workOrderTypeMapper.updateWorkOrderType(workOrderType);
    }

    @Override
    public int delete(Long[] ids) {
        // todo 判断是否关联工单
        return workOrderTypeMapper.deleteWorkOrderTypeById(ids);
    }
}
